package cn.honglian.org.service;

import cn.honglian.PethomeApp;
import cn.honglian.org.domain.Department;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest( classes = PethomeApp.class)
public class JedisTst {
    @Autowired
    private RedisTemplate redisTemplate;
    
    
    @Test
    public void test() throws Exception{
        Department department = new Department();
        department.setName("坤坤");

        redisTemplate.opsForValue().set("department",department);
        Department dept = (Department) redisTemplate.opsForValue().get("department");
        System.out.println(dept);
    }
}
